<extend name="Base/base" />

<block name="main">
    <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            配送员管理
            <small>preview of simple tables</small>
          </h1>
          <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="#">配送员信息</a></li>
            <li class="active">列表</li>
          </ol>
        </section>
        
        <!-- Main content -->
        <section class="content">
         
          <div class="row">
            <div class="col-md-12">
              <div class="box">
                <div class="box-header with-border">
                  <h3 class="box-title"><i class="fa fa-th"></i> 配送员信息管理</h3>
                </div><!-- /.box-header -->
                <div class="box-body">
                  <form  class="form-inline" action="__URL__/index" method="get">
                    <div class="form-group">
                        <label class="sr-only" for="username">username</label>
                        <input type="input" class="form-control" name="username" placeholder="按用户名查找">
                    </div>
                    <label class="sr-only"  for="area">辖区</label>
                    <select class="form-control" name="area">
                      <option value="0">--请选择辖区--</option>
                      <option value="1">小店区</option>
                      <option value="2">迎泽区</option>
                      <option value="3">杏花岭区</option>
                      <option value="4">尖草坪区</option>
                      <option value="5">万柏林区</option>
                      <option value="6">晋源区</option>                      
                    </select>
                    
                    <button type="submit" class="btn btn-default"><i class="glyphicon glyphicon-search"></i></button>
                  </form><br>

                  <table class="table table-bordered">
                    <thead>
                    <tr>
                      <th style="width:60px">ID</th>
                      <th>用户名</th>
                      <th>昵称</th>
                      <th>管辖区域</th>
                      <th>当前状态</th>
                      <th>注册时间</th>
                      <th style="width: 200px">操作</th>
                    </tr>
                    </thead>
                  <tbody>
                   <volist name="list" id="vo">
                    <tr>
                      <td> {$vo.id } </td>
                      <td>{$vo.username}</td>
                      <td>{$vo.name}</td>                      
                      <td><if condition="($vo.area eq 1) ">小店区<elseif condition="($vo.area eq 2)"/>迎泽区<elseif condition="($vo.area eq 3)"/>杏花岭区<elseif condition="($vo.area eq 4)"/>尖草坪区<elseif condition="($vo.area eq 5)"/>万柏林区<elseif condition="($vo.area eq 4)"/>晋源区</if> </td>
                      <td><if condition="($vo.status heq '0') ">禁用<elseif condition="($vo.status eq 1)"/>正在配送<elseif condition="($vo.status eq 2)"/>闲时</if></td>
                      <td>{$vo.addtime|date="Y-m-d",###}</td>
                      <td ><button class="btn btn-xs btn-danger" id="myalert" onclick="doDel(this,{$vo.id})">删除</button> 
                      <button class="btn btn-xs btn-primary" onclick="doEdit({$vo.id})">编辑</button> </td>
                    </tr>
                    </volist>
                   </tbody>
                  </table>
                </div><!-- /.box-body -->
                <div class="box-footer clearfix">
                    {$page}
                  <!-- </ul> -->
                </div>
              </div><!-- /.box -->

              
              
            </div><!-- /.col -->
            
          </div><!-- /.row -->
         
        </section><!-- /.content -->
        
</block>
<block name="myscript">

  <script type="text/javascript">

       function doDel(obj,id){
            Modal.confirm({msg:'确定要删除当前标签吗？'}).on(function(e){
                if (e) {
                    $.ajax({
                      type:"get",
                      url:"__URL__/del",
                      data:"id="+id,
                      dataType:"json",
                      success:function (data){
                        if(data.b){
                          $(obj).parents("tr").remove();
                        }
                      },
                      error:function () {
                          
                      }
                    });
                }
            })
        }
      function doEdit(id) {
          window.location.href="__CONTROLLER__/edit/id/"+id;
      }
      function doPass(id){
          window.location.href="__CONTROLLER__/pass/id/"+id;
      }
  </script>
  
</block>